﻿using CPPEI.Coolzon.Common;
using CPPEI.Coolzon.ServiceProxy.DataServiceRef;
using CPPEI.Coolzon.UI.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using Visifire.Charts;

namespace CPPEI.Coolzon.UI.DataPartLib
{
    /// <summary>
    /// Interaction logic for DataChartLine.xaml
    /// </summary>
    [System.ComponentModel.DisplayName("折线图")]
    [XPartIcon("pack://application:,,,/CPPEI.Coolzon.UI.DataPartLib;component/Images/PartIcons/折线图.png")]
    [XPart("ChartLine", "折线图")]
    public partial class DataChartLine : DataChartAxisBase
    {
        public DataChartLine()
        {
            InitializeComponent();
        }        

        protected override void OnApplyXProperty()
        {
            base.OnApplyXProperty();
        }

        protected override RenderAs GetRender(string dataSeriesId)
        {
            if (XSeriesTypeDef != null && XSeriesTypeDef.ContainsKey(dataSeriesId))
            {
                return (RenderAs)Enum.Parse(typeof(RenderAs), XSeriesTypeDef[dataSeriesId]);
            }
            else
            {
                return RenderAs.Line;
            }
        }
        protected override LineStyles GetLineStyle(string dataSeriesId)
        {
            //设置线的类型
            if (XSeriesLineStyle != null && XSeriesLineStyle.ContainsKey(dataSeriesId))
            {
                return (LineStyles)Enum.Parse(typeof(LineStyles), XSeriesLineStyle[dataSeriesId]);
            }
            return LineStyles.Solid;
        }

        protected override Chart GetChart()
        {
            return _ctlChart;
        }
    }
}
